package com.sl.au.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.customerAllocation;

//@Transactional(readOnly = true)
public interface ExdeCustomerAllocationRepository extends JpaRepository<customerAllocation, String>{
	/**
	 * 获取所有人员
	 * 
	 * @param superior
	 *            部门
	 * @return
	 */
	@Query("select u from customerAllocation u where 1=1")
	Page<customerAllocation> getUserList(Pageable pageable);
	@Query("select u from customerAllocation u where u.name like '%'+?1+'%'")
	Page<customerAllocation> getUserList(String key,Pageable pageable);
	@Query("select count(u) from customerAllocation u where u.name like '%'+?1+'%' ")
	long getUserCount(String key);
	@Query("select count(u) from customerAllocation u where 1=1 ")
	long getUserCount();
	
}
